<!--
  @author heguanghua
  @since 2020/04/16 14:50
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid"
     th:with="hasAddEdit=${#authPermit.checkPermit('/module/modify/addEdit.action')}">

    <blockquote class="layui-crumb">
        <a th:lay-href="|${SYS_MCC}/sys/detail.action?sysId=${sys.sysId}|" lay-text="系统信息" th:text="${sys.sysName}" th:if="${sys.sysId != null}">sysName</a>&nbsp;&nbsp;>&nbsp;
        <a th:lay-href="|${SYS_MCC}/module/tree.action?sysId=${obj.sysId}|" lay-text="模块管理">模块管理</a>&nbsp;&nbsp;>&nbsp;
        <zmn th:text="${(obj.moduleId eq null) ? '新增模块' : obj.moduleName}">新增或修改模块</zmn>
    </blockquote>

    <div class="layui-card">

        <div class="layui-card-body">

            <form method="POST" action="" class="layui-form" lay-filter="zmn-form">

                <input type="hidden" name="sysId" th:value="${obj.sysId}"/>
                <input type="hidden" name="parentId" th:value="${obj.parentId}"/>
                <input type="hidden" name="moduleId" th:value="${obj.moduleId}"/>

                <div class="layui-card-header layui-margin-b"><b>基本信息</b></div>

                <div class="layui-form-item layui-form-item-sm" th:if="${sys.sysId != null}">
                    <label class="layui-form-label">所属系统：</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid">
                            <span th:text="${sys.sysName}">sysName</span>
                            <span th:text="${'<' + sys.sysId + '>'}">sysId</span>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-form-item-sm" th:if="${parent.moduleId != null}">
                    <label class="layui-form-label">上级模块：</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid" th:if="${parent.parentId != null}">
                            <span th:text="${parent.moduleName}">moduleName</span>
                            <span th:text="${'<' + parent.moduleId + '>'}">moduleId</span>
                        </div>
                        <div class="layui-form-mid" th:if="${parent.parentId == null}">
                            <span>无</span>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item layui-form-item-sm" th:if="${obj.moduleId != null}">
                    <label class="layui-form-label">模块ID：</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid">
                            <span th:text="${obj.moduleId}">ID</span>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">模块名称：</label>
                    <div class="layui-input-inline" style="width:300px">
                        <input type="text" name="moduleName" th:value="${obj.moduleName}" placeholder="模块的名称" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input" maxlength="100"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">代码及路径：</label>
                    <div class="layui-input-inline" style="width:300px">
                        <input type="text" name="moduleCode" th:value="${obj.moduleCode}" placeholder="模块代码及路径" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input" maxlength="20"/>
                    </div>
                    <div class="layui-form-mid layui-word-aux">仅供开发和配置参考</div>
                </div>

                <zmn th:if="${obj.moduleId > 0}">
                    <div class="layui-card-header layui-margin-b"><b>其他信息</b></div>

                    <div class="layui-form-item layui-form-item-sm">
                        <label class="layui-form-label">修改人/时间：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid layui-word-aux" th:text="${obj.updater} + '&nbsp;/&nbsp;' + ${#dates.format(obj.updateTime, 'yyyy-MM-dd HH:mm:ss')}">修改人/时间</div>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-item-sm">
                        <label class="layui-form-label">创建人/时间：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid layui-word-aux" th:text="${obj.creater} + '&nbsp;/&nbsp;' + ${#dates.format(obj.createTime, 'yyyy-MM-dd HH:mm:ss')}">创建人/时间</div>
                        </div>
                    </div>
                </zmn>

                <div class="layui-form-item submit">
                    <div class="layui-input-block" th:if="${hasAddEdit}">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>

            </form>

        </div>

    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    layui.extend({
        module_detail: "module/zmn.module.detail",
    }).use(['index', 'module_detail']);

</script>
